<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    let waysToChange = (n) => {
      let dp = new Array(n + 1).fill(1)// 动态规划数组，初始化值为0，即没有任何物品，价值为0
      let coins = [1, 5, 10, 25]
      for (let i = 1; i < 4; i++) {//外放物
        for (let j = 1; j <= n; j++) {//内循环背包
          if (j - coins[i] >= 0) {//判断背包-外放物是否为0
            dp[j] = (dp[j] + dp[j - coins[i]]) % 1000000007
          }
        }
      }
      return dp[n]
    };
    console.log(waysToChange(5))
  </script>
</body>

</html>